
	@include('admin.head')
	<style type="text/css">

	.search-field
	{
		margin-bottom: -1px!important;
		margin-top: 1px!important;
		width: 20%!important;
	}

	</style>

	<div class="container">
		<div class="row">
			@include('admin.side')
			<div class="col-md-10" id="content-wrapper">
				<div class="row" style="min-height:500px;">
					<div class="col-lg-12">
						<div class="row">
							<div class="col-lg-12">
								<div class="main-box clearfix">
									<div class="table-responsive">
										<div class="col-xs-1" style="float:right">
								  			<a href="<%url('admin/project/add_project')%>"><button class="btn btn-primary pull_right" pid="" id="doEdit"><i class="fa fa-plus"></i></i> 添加</button></a>
								  		</div>
										<table class="table user-list" id="all-admins">
											<thead>
												<tr>
													<th data-column-id="id"><span>ID</span></th>
													<th data-column-id="name" data-sortable="false"><span>项目名称</span></th>
													<th data-column-id="description" data-formatter="description" data-sortable="false"><span>项目简介</span></th>
													<th data-column-id="investment_scale" data-sortable="false"><span>投资规模</span></th>
													<th data-column-id="address" data-sortable="false"><span>地区</span></th>
													<th data-column-id="is_financing"  data-formatter="financing" data-sortable="false"><span>融资</span></th>
													<th data-column-id="state" data-formatter="state" data-sortable="false"><span>状态</span></th>
													<th data-sortable="false" data-formatter="commands"><span>操作</span></th>
												</tr>
											</thead>
											<tbody>
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	@include("admin.footer")
	@include("admin.common")
</body>

<script type="text/javascript">

var labelsSetting = {
	infos: "当前第 {{ctx.start}} 条 到 {{ctx.end}} 条 共 {{ctx.total}} 条数据",
	search: "搜索",
	loading: "正在加载...",
	noResults: "未找到您要的数据...",
	refresh: "刷新",
	all: "全部"
};
$("#all-admins").bootgrid({
	rowCount: [10, 25, 50],
    ajax:true,
    url: "project/list",
    labels:labelsSetting,
    formatters: {
    	"commands": function(colume, row){
    		return '<a href="javascript:void(0);" pid="'+row.id+'" class="table-link doEdit"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-pencil fa-stack-1x fa-inverse"></i></span></a>' + '<a href="javascript:void(0);" pid="'+row.id+'" class="table-link doDetail"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-search-plus fa-stack-1x fa-inverse"></i></span></a>';
    	},
    	"financing": function (cloume, row){
    		switch (row.is_financing){
    			case 1:
    				return '是';
    				break;
    			case 0:
    				return '否';
    				break;
    		}
    	},
    	"description": function(k, v){
    		return v.description.substr(0, 19);
    	},
    	"state": function(k, v){
    		switch (v.verify_state){
    			case 0:
    				return '待审核';
    				break;
    			case 1:
    				return '审核通过';
    				break;
    			case 2:
    				return '审核不通过';
    				break;
    			default:
    				break;
    		}
    	}
    }
}).on("loaded.rs.jquery.bootgrid", function (e) {
	$(".doEdit").bind('click', function (){
		var pid = $(this).attr('pid');
		window.location.href="project/edit_project?pid="+pid;
	});
	$(".doDetail").bind("click", function(){
		var pid = $(this).attr('pid');
		window.location.href="project/detail_project?pid="+pid;
	})
})

//$("#all-admins-header").hide();

$(".btn-group").hide();

$("#sub").click(function(){
	var name = $("input[name='name']").val().trim();
})

</script>

</html>